<?
include"koneksi/koneksi.php"; 
if(isset($input_buku_tamu))
{
$cek=mysql_query("select count(*) as hasil from buku_tamu 
				  where id_tamu='$id_tamu'");
$cek1=mysql_fetch_row($cek);
	if($cek1[0]=='0'){
	$tanggal=date("Y-m-d");
	$tambah=mysql_query("insert into buku_tamu values 
				('$id_tamu','$nama','$email','$judul','$pesan','$tanggal')") 
				or die ("Gagal Tambah buku tamu");
	$sukses="Data Berhasil Di Input";
	header("location:index.php?act=in_tamu&sukses=$sukses");
	}
	else 
	{ 
	echo"
	<script language='javascript'>
   alert('Maaf, No buku_tamu Sudah Terdaftar !');
   history.back(1);
   </script>";
	exit();
	} 
}

?>	
